package com.example.qihuibao.dao

import androidx.room.*
import com.example.qihuibao.bean.RspQueryCanteenInfoBean
import com.example.qihuibao.bean.RspQueryEnterpriseInfoBean
import com.example.qihuibao.bean.RspQueryMealInfoBean

@Dao
interface MealInfoDao {
    @Query("SELECT * FROM MealInfo WHERE CantID IN (:cantId)")
    fun queryInCantID(cantId: String): List<RspQueryMealInfoBean>?

    @Query("SELECT * FROM MealInfo WHERE CantID IN (:cantId) AND MealID IN (:mealId)")
    fun queryInId(cantId: String, mealId: String): RspQueryMealInfoBean?

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun save(bean: RspQueryMealInfoBean) : Long
//
////    @Insert
//    @Insert(onConflict = OnConflictStrategy.REPLACE)
//    fun saveList(users: List<UserInfo>) : List<Long>?
//
    @Query("SELECT * FROM MealInfo")
    fun queryAll(): List<RspQueryMealInfoBean>?
//
//    @Delete
//    fun delete(userInfo: UserInfo)
//
    @Query("DELETE FROM MealInfo")
    fun deleteAll()
}